#include "include/floorview/floorview.h"



FloorView::FloorView()
{
    this->setBackgroundBrush(QBrush(Qt::gray, Qt::SolidPattern));



}


void FloorView::wheelEvent(QWheelEvent *event) {
   scaleView(std::pow(2.0, -event->delta() / 240.0));
}

void FloorView::scaleView(qreal scaleFactor) {
    qreal factor = matrix().scale(scaleFactor, scaleFactor).mapRect(QRectF(0, 0, 1, 1)).width();
    if (factor < 0.07 || factor > 100)
        return;

    scale(scaleFactor, scaleFactor);
    update();
}
